import { ApiProperty } from '@nestjs/swagger';
import { IsString, MinLength, IsOptional, IsEmail } from 'class-validator';

export class LoginDto {
  @IsString()
  @MinLength(6)
  @ApiProperty({ description: '用户的密码' })
  password: string;

  @IsOptional()
  @IsString()
  @ApiProperty({ description: '用户的姓名' })
  name: string;
}

export class RegisterDto {
  @IsOptional()
  @IsString()
  @ApiProperty({ description: '用户的姓名' })
  name: string;

  @IsString()
  @MinLength(6)
  @ApiProperty({ description: '用户的密码' })
  password: string;

  @IsEmail()
  @ApiProperty({ description: '用户的电子邮件' })
  email: string;
}
